home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////
- // General Initializers
- //
-
- edit_box_init:
- editbox "edit box" = "Type something into this edit box ..."
- set focus "edit box"
-
- rocket_help:
- $form_dir = formula directory
- help $form_dir,"\\formula.hlp"
-
- rocket_help_topic: tc
- $form_dir = formula directory
- help $form_dir,"\\formula.hlp" link tc
-
- start_game:
- the_game = new script "game_1.sxt"
- the_game call start_game
- free the_game
-
- start_calculator:
- calculator = new script "calc.sxt"
- calculator call init_calculator
-
- //////////////////////////////////////////
- // Hypertext control
- //
- hypertext_init:
- p1 = 0 // record history
-
- hypertext_handler: element_name, topic, hlink, p
- editbox "edit box" = "Page ",p," - ",$topic
- p2 = p1
- p1 = p
-
- hypertext_page:
- display hypertext "sample.fgh" page p
-
- hypertext_search:
- search hypertext "sample.fgh"
-
- ///////////////////////////////////////////////
- // Graph initialization procedures
- //
- // initialize graph data and color arrays
-
- init_graphs:
-
- // generate an arrays of single and multiple series graph data
-
- my_single_data = new float[10]
- for n = 0 to 9
- my_single_data[n] = rnd 100 // random values 0 to 100
-
- my_multi_data = new float[3][10]
- for n,m = 0,0 to 2,9
- my_multi_data[n][m] = rnd 100 // random values 0 to 100
-
- my_stacked_data = new float[3][10]
- for m = 0 to 9
- total = 0
- for n = 0 to 2
- total = total + my_multi_data[n][m]
- for n = 0 to 2
- my_stacked_data[n][m] = my_multi_data[n][m] / total * 100
-
- // generate pie graph data
-
- my_pie_data = new float[6]
- total = 0
- for n = 0 to 5
- my_pie_data[n] = 10 + rnd 10 // random values 10 to 20
- total = total + my_pie_data[n]
- for n = 0 to 5
- my_pie_data[n] = (my_pie_data[n] / total * 100) ~ 3
- // ~ 3 - only three significant digits
-
- // generate an array of colors
-
- my_colors = new byte[6][3]
- my_colors[0][0] = 0,128,192 // blue
- my_colors[1][0] = 192,96,128 // pink
- my_colors[2][0] = 96,192,96 // green
- my_colors[3][0] = 0,128,192 // blue
- my_colors[4][0] = 192,96,128 // pink
- my_colors[5][0] = 96,192,96 // green
-
- //////////////////////////////////////////
- // Graph handlers
- //
- // return the graph data, colors, min value, max value, and increment
-
- graph_handler_1: element_name
-
- return @my_single_data, @my_colors, 0, 100, 10
-
- graph_handler_2: element_name
-
- return @my_multi_data, @my_colors, 0, 100, 10
-
- graph_handler_3: element_name
-
- return @my_stacked_data, @my_colors, 0, 100, 10
-
- graph_handler_4: element_name
-
- return @my_pie_data, @my_colors, 0, 100, 10
-
- //////////////////////////////////////////
- // 3D Graph
- //
-
- draw_3D_graph:
- call space_cleanup
- the_graph = new script "graph3d.sxt"
- the_graph call display_graph
- free the_graph
-
- //////////////////////////////////////////
- // 3D Spaceship
- //
-
- space_initialize:
- break mode FALSE
- the_spaceship = new script "starwar.sxt"
- the_spaceship call initialize
-
- space_mouse_move: x, y
- the_spaceship call draw_angle: x, y
-
- space_cleanup:
- free the_spaceship
-
- //////////////////////////////////////////
- // List box
- //
-
- init_listbox:
- $alphabet = "abcdefghijklmnopqrstuvwxyz"
-
- listbox "list box" tabs 0,60,120
- for n = 1 to 40
- my_length = 3 + rnd 10
- my_offset = rnd (26 - my_length)
- $item1 = $alphabet stroff my_offset strcnt my_length
- my_length = 3 + rnd 10
- my_offset = rnd (26 - my_length)
- $item2 = $alphabet stroff my_offset strcnt my_length
- listbox "list box" add n,". ",$item1," ",$item2
-
-
-
-
-